# Maintainer: Thomas Dziedzic < gostrc at gmail >
# Contributor: François Charette <firmicus ατ gmx δοτ net>
# Contributor: Alex Dioso <adioso->gmail*com>

pkgname=perl-clone
pkgver=0.39
pkgrel=4
pkgdesc='Recursive copy of nested objects.'
arch=('i686' 'x86_64')
url='http://search.cpan.org/~RDF/Clone'
license=('GPL' 'PerlArtistic')
depends=('perl')
options=('!emptydirs')
source=("http://search.cpan.org/CPAN/authors/id/G/GA/GARU/Clone-$pkgver.tar.gz")
sha256sums=('acb046683e49d650b113634ecf57df000816a49e611b0fff70bf3f93568bfa2d')

build() {
  cd  Clone-${pkgver}
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
  make
}

package() {
  cd  Clone-${pkgver}
  make DESTDIR=${pkgdir} install
  find ${pkgdir} -name '.packlist' -delete
  find ${pkgdir} -name '*.pod' -delete

# template start; name=perl-binary-module-dependency; version=1;
if [[ $(find "$pkgdir/usr/lib/perl5/" -name "*.so") ]]; then
	_perlver_min=$(perl -e '$v = $^V->{version}; print $v->[0].".".($v->[1]);')
	_perlver_max=$(perl -e '$v = $^V->{version}; print $v->[0].".".($v->[1]+1);')
	depends+=("perl>=$_perlver_min" "perl<$_perlver_max")
fi
# template end;
}
